﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <qgraphicsview.h>
#include "serialmanager.h"
#include "connetionsttings.h"
#include "cylinderspeed.h"
#include <QtCharts/QtCharts>

QT_BEGIN_NAMESPACE
namespace Ui
{
    class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget* parent = nullptr);
    ~MainWindow();

public:
    ConnetionSttings* connectionDialog;
    serialManager* serialPort;
    cylinderspeed* cylinderSpeed;

    //专门用于连接信号和槽函数
    void connectSignal2Slots();
    //图表的初始化
    void chartsInit();
    //液压缸速度控制组件使用
    void cylinderControl();
    //开关阀单点控制组件使用
    void hyvlavecontrol();

    QChart* cylinderSpeedChart;
    QLineSeries* cylinderSpeedLineSeries;
    QValueAxis* cylinderSpeedaxisX;
    QValueAxis* cylinderSpeedaxisY;


public slots:
    void slotopenConnectionDialog();
    void slotDispalyMessage(const QString& message);


private:
    Ui::MainWindow* ui;
};
#endif // MAINWINDOW_H
